<?php
/**
 * 
 * Upload Audio Asset
 * 
 * This file takes the audio asset that the user is trying to up load
 *
 * @author Nicola Wilkinson
 * 
 * @copyright 2007 Loughborough University
 * @license http://www.gnu.org/licenses/gpl.txt
 * @version 0.0.0.1
 * @since 11 Nov 2009
 * 
 */
 
 function logit($input) {
     $handle = fopen('__log.txt', "a");
     fwrite($handle, var_export($input, true) . "\n");
 }
 
 $tempFile = $_FILES['file']['tmp_name'];
 $fileName = $_FILES['file']['name'];
 $fileSize = $_FILES['file']['size'];
 
 
 $folder = $_POST["targetFolder"];

 logit("----------------------------------- UPLOADING SOUND FILE TO SERVER -----------------------------");
 logit("Temp file name:     ".$tempFile);
 logit("File size :         " . $fileSize);
 logit("Destination folder: ".$folder);
 logit("----------------------------------- FINISHED UPLOADING SOUND FILE  -----------------------------");
 
 
 move_uploaded_file($tempFile, "../" . $folder . $fileName);
 
?>